Data transported in a communications network is typically encapsulated in multiple layers of protocols, where each protocol has one or many stacked headers. For example, TCP (Transmission Control Protocol) over Ipv6 (Internet Protocol version 6) with stacked options, TCP over Ipsec (IP Security) over IP, or multiple stacked MPLS (MultiProtocol Label Switching) headers.
Tunneling enables traffic from one protocol to be carried inside the same or another similar layer protocol. For example IP carried inside MPLS, or SNA's (System Network Architecture) SDLC (Synchronous Data Link Architecture) packets and IPX (Intemetwork Packet Exchange) can be carried inside IP.
In some cases, e.g. packet inspection in firewalls or Field Manipulation in NAT (Network Address Translation), there is a need to inspect and manipulate fields deep inside the packet, such as protocols corresponding to OSI (Open System Interconnection) layers higher than 3. See for example U.S. Pat. No. 5,884,025-A.
The combination of stacked headers is often dynamic and the communications equipment needs to be able to analyse the headers by inspecting certain fields and unwind these headers at runtime. Normally field inspection and manipulation by means of special purpose hardware is only capable of processing fixed size headers of OSI layer 2 and 3. Processing that needs to inspect fields deep in a packet or to unwind dynamic length headers, is performed more or less in software on a general-purpose processor, with resulting loss of wire speed performance. The more headers that need to be unwind to locate a particular field the more execution time a processor needs, since the software has to analyse or unwind one header at a time. This implies both that inspection and modification deep in a packet takes a long time and different times depending on the specific header configuration. Different times for different headers render a parallel processing of different packets more difficult.